﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJ.Data.Inventory;
using PJ.Framework.Common;

namespace PJ.Business.Inventory
{
    /// <summary>
    /// InventoryItemOrderParamService class
    /// </summary>
    /// <typeparam name="O">Object to serve type</typeparam>
    /// <typeparam name="OD">Inner data object type</typeparam>
    /// <typeparam name="ODP">Inner data object provider type</typeparam>
    public abstract class InventoryItemOrderParamService<OI, OD, ODP> : EntityService<OI, OD, ODP>, IInventoryItemOrderParamService
        where OI : class, IInventoryItemOrderParam
        where OD : class, IInventoryItemOrderParamData
        where ODP : class, IInventoryItemOrderParamProvider<OD>
    {
        #region Constructor

        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="dataService">Data provider</param>
        /// <param name="itemService">Item service</param>
        protected InventoryItemOrderParamService(ODP dataService)
            : base(dataService)
        {
        }

        #endregion

        #region Interface implementation
        /// <summary>
        /// Inventory item service
        /// </summary>
        public IInventoryItemService InventoryItemService
        {
            get
            {
                if (_InventoryItemService == null)
                    _InventoryItemService = InjectionBroker.Resolve<IInventoryItemService>();
                return _InventoryItemService;
            }
        }
        #endregion
        #region Interface override
        public IEntityService OwnerService
        {
            get { return InventoryItemService; }
        }
        #endregion
        #region Public
        #endregion
        #region Protected
        #endregion
        #region Private
        #endregion
        #region Field
        private IInventoryItemService _InventoryItemService;
        #endregion

    }
}
